package com.qianyu.project.web.controller.zxm;

import com.qianyu.project.entity.SecurityLog;
import com.qianyu.project.service.ISecurityLogService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zxm
 * @date 2021/2/2 15:36
 */
@RestController
@RequestMapping("/SecurityLog")
public class SecurityLogController {
    @Autowired
    ISecurityLogService iSecurityLogService;
    @GetMapping("")
    public Result getSecurityLogList(SecurityLog sl){
        return ResultTool.success(iSecurityLogService.getSecurityLogList(sl));
    }
    @GetMapping("/ProjectName")
    public Result getProjectName(){
        return ResultTool.success(iSecurityLogService.getProjectName());
    }
    @GetMapping("/DeptName")
    public Result getDeptName(){
        return ResultTool.success(iSecurityLogService.getDeptName());
    }
    @GetMapping("/UserName")
    public Result getUserName(){
        return ResultTool.success(iSecurityLogService.getUserName());
    }
    @DeleteMapping("{id}")
    public void deleteSecurityLogId(@PathVariable("id") String id){
        iSecurityLogService.deleteSecurityLogId(id);
    }
    @GetMapping("/getSecurityLogId/{id}")
    public  Result getSecurityLogId(@PathVariable("id") String id){
           return  ResultTool.success(iSecurityLogService.getSecurityLogId(id));
    }
    @PostMapping("")
    public  void addSecurityLog(@RequestBody SecurityLog ss){
        iSecurityLogService.addSecurityLog(ss);
    }
    @PutMapping("")
    public  void updateSecurityLog(@RequestBody SecurityLog sl){
        iSecurityLogService.updateSecurityLog(sl);
    }
}
